package subject_set.weekly_competition.day10_15;

/**
 * @author haomin
 * @date 2022/10/15 22:20
 **/
public class Num1 {
    class Solution {
        public int countTime(String time) {
            int a = 0, b = 0;
            if(time.charAt(0) == '?' && time.charAt(1) == '?') a = 24;
            else if(time.charAt(0) == '?' && time.charAt(1) != '?'){
                if((time.charAt(1)-'0') < 4) a = 3;
                else a = 2;
            } else if(time.charAt(0) != '?' && time.charAt(1) == '?'){
                if((time.charAt(0) - '0') != 2) a = 10;
                else a = 4;
            } else if(time.charAt(0) != '?' && time.charAt(1) != '?') a = 1;

            if(time.charAt(3) == '?' && time.charAt(4) == '?') b = 60;
            else if(time.charAt(3) == '?' && time.charAt(4) != '?'){ b = 6;
            } else if(time.charAt(3) != '?' && time.charAt(4) == '?'){ b = 10;
            } else if(time.charAt(3) != '?' && time.charAt(4) != '?') b = 1;

            return a * b;
        }
    }
}